<% @page_title = "Check reserved book" %>
<%= stylesheet_link_tag "admin/view-item", :media => "all" %>
<div class="check-reserved-book-info">
	<h1>Check reserved book</h1>
	<p>
		<label><strong>ID:</strong></label>&nbsp;
		<%= @reserved_book.id %>
	</p>
	<p>
		<label><strong>Book Title:</strong></label>&nbsp;
		<%= link_to @reserved_book.book.title, :controller => 'admin/book', :action => 'view', :id => @reserved_book.book.id %>
	</p>
	<p>
		<label><strong>Available:</strong></label>&nbsp;
		<%= @reserved_book.book.free_quantity %>
	</p>
	<p>
		<label><strong>Reserved Reader:</strong></label>&nbsp;
		<%= link_to @reserved_book.user.fullname, :controller => 'admin/user', :action => 'view', :id => @reserved_book.user.id %>
	</p>
	<p>
		<label><strong>Reserved Time:</strong></label>&nbsp;
		<%= @reserved_book.created_at %>
	</p>
</div>
<div class='clear'></div>
<div class='actions'>
	<% if @reserved_book.is_checked == 0 and @reserved_book.book.free_quantity > 0 %>
	<%= link_to "Send notification email", :controller => "admin/book_reserve", :action => "check", :send_email => true, :id => @reserved_book.id %>
	<% end %>
	<%= link_to "Delete", :controller => "admin/book_reserve", :action => "delete", :id => @reserved_book.id, :method => "delete", :data => {:confirm => "Are you sure?"} %>
	<%= link_to "Back", :controller => "admin/book_reserve", :action => "index" %>
</div>
<% if flash[:notice] %>
	<h4 style='color: red'><%= flash[:notice] %></h4>
<% end %>
